package Persondata;

import org.apache.wicket.markup.html.basic.Label;
import org.apache.wicket.markup.html.panel.Panel;
import org.apache.wicket.model.CompoundPropertyModel;
import org.apache.wicket.model.PropertyModel;

public class PersonPanel extends Panel{
	
	public PersonPanel(String id){
		super(id);
		Person person=new Person("Reischmann","Tobias",21,"Werkstudent");
		CompoundPropertyModel<Person> model= new CompoundPropertyModel<Person>(person);
		setDefaultModel(model);
		add (new Label("name",new PropertyModel<Person>(person, "name")));
		add (new Label("vorname",new PropertyModel<Person>(person, "vorname")));
		add (new Label("age",new PropertyModel<Person>(person, "age")));
		add (new Label("job",new PropertyModel<Person>(person, "job")));
		
		
	}
	
	public PersonPanel(String id, Person person){
		super(id);
		CompoundPropertyModel<Person> model= new CompoundPropertyModel<Person>(person);
		setDefaultModel(model);
		add (new Label("name",new PropertyModel<Person>(person, "name")));
		add (new Label("vorname",new PropertyModel<Person>(person, "vorname")));
		add (new Label("age",new PropertyModel<Person>(person, "age")));
		add (new Label("job",new PropertyModel<Person>(person, "job")));
		
		
	}

}
